package com.example.monitoringsystem.controller;

import com.example.monitoringsystem.bean.User;
import com.example.monitoringsystem.currentUser.StaticUser;
import com.example.monitoringsystem.service.FindPatientService;
import com.example.monitoringsystem.service.impl.FindPatientServiceimpl;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.Map;
@RestController
public class FindPatientController {
    @Autowired
    FindPatientService findPatientService;
    //返回医生所有患者表
    @RequestMapping( "/doctor/findPatient")
    @ResponseBody
    public Object  getPatientByDoctor()
    {
        int id=StaticUser.getCurrentUser ().getId ();
      Object object=findPatientService.findPatientByDoctor (id);
return  object;
    }
    //返回所有医生患者用户表
    @RequestMapping( "/doctor/myPatient")
    @ResponseBody
    public Object  getPatientUserByDoctor()
    {
        int id=StaticUser.getCurrentUser ().getId ();
        Object object=findPatientService.findPatientUserByDoctor (id);
        return  object;
    }
    //返回管理员所有患者用户表
    @RequestMapping("/administrator/findAllPatientUser")
    @ResponseBody
    public Object  getAllPatientUser()
    {
        Object object=findPatientService.findAllPatientUser ();
        return  object;
    }
    //返回管理员所有患者表
    @RequestMapping("/administrator/findPatient")
    @ResponseBody
    public Object  getAllPatient()
    {
        Object object=findPatientService.findAllPatient ();
        return  object;
    }
}
